<extend name='Public/demo' />
<block name="contents">
123123123
<!-- banner S -->
    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
      <!-- Indicators -->
        <ol class="carousel-indicators">
<!--           <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
          <li data-target="#carousel-example-generic" data-slide-to="1"></li>
          <li data-target="#carousel-example-generic" data-slide-to="2"></li>
          <li data-target="#carousel-example-generic" data-slide-to="3"></li>
          <li data-target="#carousel-example-generic" data-slide-to="4"></li> -->
      </ol>

      <!-- Wrapper for slides -->
      <div class="carousel-inner" role="listbox">
      <?php foreach($banner as $key => $val){ ?>
        <?php if($key == 0){ ?>
        <div class="item active">
        <?php }else{ ?>
        <div class="item">
        <?php  } ?>
          <img src="__PUBLIC__<?php echo $val; ?>" >
        </div>
      <?php } ?>

      </div>

      <!-- Controls -->
      <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
      </a>
      <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
      </a>
    </div>
    <!-- banner E -->
    <!-- 特权说明S -->
    <div class="panel panel-default">
        {$contents}
    </div>
    <!-- 特权说明E -->
    <script type="text/javascript">
      $('.item').each(function(){
        //得到当前的元素的索引
        var inth = $(this).index();
        if (inth ==0) {
          var str = '<li data-target="#carousel-example-generic" data-slide-to="'+ inth +'" class="active"></li>';
        }else{
          var str = '<li data-target="#carousel-example-generic" data-slide-to="'+ inth +'"></li>';
        }

        //将内容插入到点点里
        $('.carousel-indicators').append(str);
      });
    </script>
</block>
